#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 3e5 + 10;
struct node {
    ll a, b;
}p[N];
bool cmp(node x, node y) {
    return x.a > y.a;
}
ll n, m;
int main() {
    cin >> n >> m;
    for (int i = 1;i <= n;i++) {
        cin >> p[i].a >> p[i].b;
    }
    sort(p + 1, p + n + 1, cmp);

    ll res = 0;

    for (int i = 1;i <= n;i++) {
        if (m >= p[i].b) {
            res += p[i].a * p[i].b;
            m -= p[i].b;
        }
        else {
            res += m * p[i].a;
            m = 0;
        }
        if (m <= 0) break;
    }
    cout << res << endl;
}